/*     */ package com.lmpop.trade.ti_comment;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import com.lmpop.frame.util.HtmlRegexpUtil;
/*     */ import com.lmpop.frame.util.RandomID;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ 
/*     */ public class Ti_commentInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_commentInfo()
/*     */   {
/*  16 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  27 */     HtmlRegexpUtil.reSetFilterRegexpArray();
/*     */ 
/*  29 */     Ti_comment ti_comment = new Ti_comment();
/*  30 */     String result_code = "0";
/*  31 */     String result_info = "";
/*  32 */     RandomID randomID = new RandomID();
/*  33 */     String info_id = randomID.GenTradeId();
/*  34 */     String userrand = map.getString("userrand");
/*  35 */     String randcode = map.getString("randcode");
/*  36 */     if ((!userrand.equals("")) && (!userrand.trim().equals(randcode.trim()))) {
/*  37 */       result_info = "验证码输入不正确!";
/*  38 */       result_code = "1";
/*     */     }
/*     */     else {
/*  41 */       ti_comment.setTrade_id(info_id);
/*  42 */       ti_comment.setInfo_id(map.getString("info_id"));
/*  43 */       ti_comment.setContent(HtmlRegexpUtil.fiterHtmlTag(map.getString("content")));
/*  44 */       ti_comment.setCust_id(map.getString("session_cust_id"));
/*  45 */       ti_comment.setIn_date(map.getString("in_date"));
/*  46 */       ti_comment.setB_content(HtmlRegexpUtil.fiterHtmlTag(map.getString("b_content")));
/*  47 */       ti_comment.setUser_id(map.getString("user_id"));
/*     */       try
/*     */       {
/*  51 */         insert(dbmMgr, ti_comment);
/*     */       } catch (ApplicationException e) {
/*  53 */         e.printStackTrace();
/*  54 */         result_code = "1";
/*     */       }
/*     */     }
/*  57 */     map.setString("result_code", result_code);
/*  58 */     map.setString("result_info", result_info);
/*     */ 
/*  60 */     return map;
/*     */   }
/*     */ 
/*     */   public SysMap insertMessage(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  66 */     HtmlRegexpUtil.reSetFilterRegexpArray();
/*     */ 
/*  68 */     Ti_comment ti_comment = new Ti_comment();
/*  69 */     String result_code = "0";
/*  70 */     String result_info = "";
/*  71 */     String b_content = ""; String content = ""; String session_cust_id = ""; String user_id = "";
/*  72 */     RandomID randomID = new RandomID();
/*  73 */     String info_id = randomID.GenTradeId();
/*  74 */     ti_comment.setTrade_id(info_id);
/*  75 */     ti_comment.setInfo_id(info_id);
/*  76 */     if (map.getString("content") != null) {
/*  77 */       content = map.getString("content").toString();
/*     */     }
/*  79 */     if (map.getString("b_content") != null) {
/*  80 */       b_content = map.getString("b_content").toString();
/*     */     }
/*  82 */     if (map.getString("session_cust_id") != null) {
/*  83 */       session_cust_id = map.getString("session_cust_id").toString();
/*     */     }
/*  85 */     if (map.getString("user_id") != null) {
/*  86 */       user_id = map.getString("user_id").toString();
/*     */     }
/*  88 */     ti_comment.setContent(HtmlRegexpUtil.fiterHtmlTag(content));
/*  89 */     ti_comment.setB_content(HtmlRegexpUtil.fiterHtmlTag(b_content));
/*  90 */     ti_comment.setCust_id(session_cust_id);
/*  91 */     ti_comment.setUser_id(user_id);
/*     */     try
/*     */     {
/*  95 */       insert(dbmMgr, ti_comment);
/*     */     } catch (ApplicationException e) {
/*  97 */       e.printStackTrace();
/*  98 */       result_code = "1";
/*     */     }
/* 100 */     map.setString("result_code", result_code);
/* 101 */     map.setString("result_info", result_info);
/* 102 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_comment ti_comment)
/*     */     throws ApplicationException
/*     */   {
/* 111 */     dbmMgr.update("insertTi_comment", ti_comment);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 121 */     String pkid_string = map.getString("pkid");
/* 122 */     String result_code = "0";
/*     */     try {
/* 124 */       if (!pkid_string.equals("")) {
/* 125 */         String[] pkStr = pkid_string.split("\\|");
/* 126 */         for (int i = 0; i < pkStr.length; i++) {
/* 127 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/* 131 */       e.printStackTrace();
/* 132 */       result_code = "1";
/*     */     }
/* 134 */     map.setString("result_code", result_code);
/* 135 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 144 */     dbmMgr.update("deleteTi_comment", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 153 */     Ti_comment ti_comment = new Ti_comment();
/* 154 */     ti_comment.setTrade_id(map.getString("trade_id"));
/* 155 */     ti_comment.setInfo_id(map.getString("info_id"));
/* 156 */     ti_comment.setContent(map.getString("content"));
/* 157 */     ti_comment.setCust_id(map.getString("cust_id"));
/* 158 */     ti_comment.setIn_date(map.getString("in_date"));
/* 159 */     ti_comment.setB_content(map.getString("b_content"));
/* 160 */     ti_comment.setUser_id(map.getString("user_id"));
/*     */ 
/* 162 */     String result_code = "0";
/*     */     try {
/* 164 */       update(dbmMgr, ti_comment);
/*     */     } catch (ApplicationException e) {
/* 166 */       e.printStackTrace();
/* 167 */       result_code = "1";
/*     */     }
/* 169 */     map.setString("result_code", result_code);
/* 170 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_comment ti_comment)
/*     */     throws ApplicationException
/*     */   {
/* 179 */     dbmMgr.update("updateTi_comment", ti_comment);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 189 */     Hashtable ti_comment = (Hashtable)obj;
/* 190 */     if (start == 0)
/* 191 */       start = 0;
/*     */     else {
/* 193 */       start = (start - 1) * limit;
/*     */     }
/* 195 */     ti_comment.put("start", Integer.valueOf(start));
/* 196 */     ti_comment.put("limit", Integer.valueOf(limit));
/* 197 */     return this.queryList.getList("getListByTi_commentPage", ti_comment);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 208 */     Hashtable ti_comment = (Hashtable)obj;
/* 209 */     List list = this.queryList.getList("getCountByObjTi_comment", ti_comment);
/* 210 */     int count = 0;
/* 211 */     if ((list != null) && (list.size() > 0)) {
/* 212 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 213 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 214 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 217 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 227 */     return this.queryList.getList("getTi_commentByPk", pk);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_comment.Ti_commentInfo
 * JD-Core Version:    0.6.0
 */